{template 'common/header'}
<ul class="nav nav-tabs">
	<li><a href="{php echo $this->createWebUrl('user');}">商品列表</a></li>
	<li class="active"><a href="{php echo $this->createWebUrl('user_add', array('op'=>'add'));}">添加商品</a></li>
</ul>
<div class="main">
	<form action="" method="post" class="form-horizontal form" id="form">
		<div class="panel panel-default">
			<div class="panel-heading">便利店 - 用户</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">用户名称</label>
					<div class="col-xs-12 col-sm-8">
						<input type="text" name="name" class="form-control" value="{$data['name']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">手机号</label>
					<div class="col-xs-12 col-sm-8">
						<input type="text" name="phone" class="form-control" value="{$data['phone']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">头像</label>
					<div class="col-xs-12 col-sm-8">
						{php echo tpl_form_field_image('img');}
					</div>
				</div>
				<div class="form-group">
					<div class="col-xs-12 col-sm-9 col-md-10 col-lg-10 col-sm-offset-3 col-md-offset-2 col-lg-offset-2">
						
						<input name="submit" type="submit" value="提交" class="btn btn-primary" />
					
					</div>
				</div>
			</div>
		</div>
	</form>
</div>

<script>
require(['jquery', 'util'], function($, util){
	$(function(){
		$("input[name='img']").val("{$data['img']}")
		$(".img-responsive").attr("src",'/attachment/'+"{$data['img']}")
	});
});
</script>

{template 'common/footer'}